package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);
    int insert(Employee record);
    Employee selectByPrimaryKey(Long id);
    List<Employee> selectAll();
    int updateByPrimaryKey(Employee record);
    int selectForCount(QueryObject qo);
    List<Employee> selectForList(QueryObject qo);

    //关系
    void insertRelation(@Param("employeeId") Long employeeId, @Param("roleId") Long roleId);
    void deleteRelation(Long id);

    //登录
    Employee login(@Param("username") String username, @Param("password") String password);
    //设置密码
    void setPassword(@Param("id") Long id, @Param("password") String password);

    //批量删除
    void beatchDelete(@Param("ids") Long[] ids);

    //删除关系
    void deleteBeatchRelation(@Param("ids") Long[] ids);

    Employee selectByName(String name);

    //用户状态  禁用
    void updateSeleteById(@Param("id") Long id, @Param("status") boolean status);

    Employee selectById(Long id);

    List<Employee> selectByRoleSn(String[] sns);

}